home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-08-10 | 16.5 KB | 495 lines | [TEXT/MPS ] |
- (*
- File: PPCToolbox.mod
-
- Contains: Program-Program Communications Toolbox Interfaces.
-
- Version: Technology: System 7.5
- Package: Universal Interfaces 2.0 in “MPW Latest” on ETO #17
-
- Copyright: © 1984-1995 by Apple Computer, Inc.
- All rights reserved.
-
- Bugs?: If you find a problem with this file, use the Apple Bug Reporter
- stack. Include the file and version information (from above)
- in the problem description and send to:
- Internet: apple.bugs.applelink.apple.com
- AppleLink: APPLE.BUGS
-
- *)
-
- (*$TAGS-*)
- (*$CALLING PASCAL*)
- MODULE PPCToolbox;
-
- IMPORT SYSTEM, Types, Memory, AppleTalk;
-
- (* $PUSH*)
- (* $ALIGN MAC68K*)
- (* $LibExport+*)
-
- TYPE
- PPCServiceType* = CHAR;
-
-
- CONST
- ppcServiceRealTime* = 1;
-
-
- TYPE
- PPCLocationKind* = INTEGER;
-
-
- CONST
- ppcNoLocation* = 0; (* There is no PPCLocName *)
- ppcNBPLocation* = 1; (* Use AppleTalk NBP *)
- ppcNBPTypeLocation* = 2; (* Used for specifying a location name type during PPCOpen only *)
-
-
- TYPE
- PPCPortKinds* = INTEGER;
-
-
- CONST
- ppcByCreatorAndType* = 1; (* Port type is specified as colloquial Mac creator and type *)
- ppcByString* = 2; (* Port type is in pascal string format *)
-
- (* Values returned for request field in PPCInform call *)
-
- TYPE
- PPCSessionOrigin* = CHAR;
-
-
- CONST
- (* Values returned for requestType field in PPCInform call *)
- ppcLocalOrigin* = 1; (* session originated from this machine *)
- ppcRemoteOrigin* = 2; (* session originated from remote machine *)
-
-
- TYPE
- PPCPortRefNum* = INTEGER;
-
- PPCSessRefNum* = LONGINT;
-
- PPCPortRec* = RECORD
- nameScript*: Types.ScriptCode; (* script of name *)
- name*: Types.Str32; (* name of port as seen in browser *)
- portKindSelector*: PPCPortKinds; (* which variant *)
- (*ΔΔ CASE INTEGER OF
- 0: ( *)
- END;
- PPCPortByStringPtr* = POINTER TO PPCPortByStringRec;
- PPCPortByStringRec* = RECORD(PPCPortRec)
- portTypeStr*: Types.Str32; (* pascal type string *)
- (*ΔΔ );
- 1: ( *)
- END;
- PPCPortByCreatorAndTypePtr* = POINTER TO PPCPortByCreatorAndTypeRec;
- PPCPortByCreatorAndTypeRec* = RECORD(PPCPortRec)
- portCreator*: Types.OSType;
- portType*: Types.OSType;
- (*ΔΔ );*)
- END;
-
- PPCPortPtr* = POINTER TO PPCPortRec;
-
- LocationNameRec* = RECORD
- locationKindSelector*: PPCLocationKind; (* which variant *)
- (*ΔΔ CASE INTEGER OF
- 0: ( *)
- END;
- NBPLocationPtr* = POINTER TO NBPLocationRec;
- NBPLocationRec* = RECORD(LocationNameRec)
- nbpEntity*: AppleTalk.EntityName; (* NBP name entity *)
- (*ΔΔ );
- 1: ( *)
- END;
- NBPTypeLocationPtr* = POINTER TO NBPTypeLocationRec;
- NBPTypeLocationRec* = RECORD(LocationNameRec)
- nbpType*: Types.Str32; (* just the NBP type string, for PPCOpen *)
- (*ΔΔ );*)
- END;
-
- LocationNamePtr* = POINTER TO LocationNameRec;
-
- PortInfoRec* = RECORD
- filler1*: Types.SInt8; (* unsigned char *)
- authRequired*: BOOLEAN;
- name*: PPCPortRec;
- END;
-
- PortInfoPtr* = POINTER TO PortInfoRec;
-
- PortInfoArrayPtr* = POINTER TO PortInfoRec;
-
- PPCParamBlockPtr* = POINTER TO PPCParamBlockRec;
-
- PPCCompProcPtr* = (*ΔΔ Types.ProcPtr;*) PROCEDURE (pb: PPCParamBlockPtr);
- PPCCompUPP* = Types.UniversalProcPtr;
-
- PPCOpenPBRec* = (*ΔΔPACKEDΔΔ*) RECORD
- qLink*: Types.Ptr;
- csCode*: INTEGER;
- intUse*: INTEGER;
- intUsePtr*: Types.Ptr;
- ioCompletion*: PPCCompUPP;
- ioResult*: Types.OSErr;
- Reserved*: ARRAY 5 (*ΔΔ[0..4]ΔΔ*) OF LONGINT;
- portRefNum*: PPCPortRefNum; (* 38 <-- Port Reference *)
- filler1*: LONGINT;
- serviceType*: PPCServiceType; (* 44 --> Bit field describing the requested port service *)
- resFlag*: Types.UInt8; (* Must be set to 0 *)
- portName*: PPCPortPtr; (* 46 --> PortName for PPC *)
- locationName*: LocationNamePtr; (* 50 --> If NBP Registration is required *)
- networkVisible*: BOOLEAN; (* 54 --> make this network visible on network *)
- nbpRegistered*: BOOLEAN; (* 55 <-- The given location name was registered on the network *)
- END;
-
- PPCOpenPBPtr* = POINTER TO PPCOpenPBRec;
-
- PPCInformPBRec* = (*ΔΔPACKEDΔΔ*) RECORD
- qLink*: Types.Ptr;
- csCode*: INTEGER;
- intUse*: INTEGER;
- intUsePtr*: Types.Ptr;
- ioCompletion*: PPCCompUPP;
- ioResult*: Types.OSErr;
- Reserved*: ARRAY 5 (*ΔΔ[0..4]ΔΔ*) OF LONGINT;
- portRefNum*: PPCPortRefNum; (* 38 --> Port Identifier *)
- sessRefNum*: PPCSessRefNum; (* 40 <-- Session Reference *)
- serviceType*: PPCServiceType; (* 44 <-- Status Flags for type of session, local, remote *)
- autoAccept*: BOOLEAN; (* 45 --> if true session will be accepted automatically *)
- portName*: PPCPortPtr; (* 46 --> Buffer for Source PPCPortRec *)
- locationName*: LocationNamePtr; (* 50 --> Buffer for Source LocationNameRec *)
- userName*: Types.StringPtr; (* 54 --> Buffer for Soure user's name trying to link. *)
- userData*: LONGINT; (* 58 <-- value included in PPCStart's userData *)
- requestType*: PPCSessionOrigin; (* 62 <-- Local or Network *)
- END;
-
- PPCInformPBPtr* = POINTER TO PPCInformPBRec;
-
- PPCStartPBRec* = (*ΔΔPACKEDΔΔ*) RECORD
- qLink*: Types.Ptr;
- csCode*: INTEGER;
- intUse*: INTEGER;
- intUsePtr*: Types.Ptr;
- ioCompletion*: PPCCompUPP;
- ioResult*: Types.OSErr;
- Reserved*: ARRAY 5 (*ΔΔ[0..4]ΔΔ*) OF LONGINT;
- portRefNum*: PPCPortRefNum; (* 38 --> Port Identifier *)
- sessRefNum*: PPCSessRefNum; (* 40 <-- Session Reference *)
- serviceType*: PPCServiceType; (* 44 <-- Actual service method (realTime) *)
- resFlag*: Types.UInt8; (* 45 --> Must be set to 0 *)
- portName*: PPCPortPtr; (* 46 --> Destination portName *)
- locationName*: LocationNamePtr; (* 50 --> NBP or NAS style service location name *)
- rejectInfo*: LONGINT; (* 54 <-- reason for rejecting the session request *)
- userData*: LONGINT; (* 58 --> Copied to destination PPCInform parameter block *)
- userRefNum*: LONGINT; (* 62 --> userRefNum (obtained during login process) *)
- END;
-
- PPCStartPBPtr* = POINTER TO PPCStartPBRec;
-
- PPCAcceptPBRec* = RECORD
- qLink*: Types.Ptr;
- csCode*: INTEGER;
- intUse*: INTEGER;
- intUsePtr*: Types.Ptr;
- ioCompletion*: PPCCompUPP;
- ioResult*: Types.OSErr;
- Reserved*: ARRAY 5 (*ΔΔ[0..4]ΔΔ*) OF LONGINT;
- filler1*: INTEGER;
- sessRefNum*: PPCSessRefNum; (* 40 --> Session Reference *)
- END;
-
- PPCAcceptPBPtr* = POINTER TO PPCAcceptPBRec;
-
- PPCRejectPBRec* = RECORD
- qLink*: Types.Ptr;
- csCode*: INTEGER;
- intUse*: INTEGER;
- intUsePtr*: Types.Ptr;
- ioCompletion*: PPCCompUPP;
- ioResult*: Types.OSErr;
- Reserved*: ARRAY 5 (*ΔΔ[0..4]ΔΔ*) OF LONGINT;
- filler1*: INTEGER;
- sessRefNum*: PPCSessRefNum; (* 40 --> Session Reference *)
- filler2*: INTEGER;
- filler3*: LONGINT;
- filler4*: LONGINT;
- rejectInfo*: LONGINT; (* 54 --> reason for rejecting the session request *)
- END;
-
- PPCRejectPBPtr* = POINTER TO PPCRejectPBRec;
-
- PPCWritePBRec* = RECORD
- qLink*: Types.Ptr;
- csCode*: INTEGER;
- intUse*: INTEGER;
- intUsePtr*: Types.Ptr;
- ioCompletion*: PPCCompUPP;
- ioResult*: Types.OSErr;
- Reserved*: ARRAY 5 (*ΔΔ[0..4]ΔΔ*) OF LONGINT;
- filler1*: INTEGER;
- sessRefNum*: PPCSessRefNum; (* 40 --> Session Reference *)
- bufferLength*: Memory.Size; (* 44 --> Length of the message buffer *)
- actualLength*: Memory.Size; (* 48 <-- Actual Length Written *)
- bufferPtr*: Types.Ptr; (* 52 --> Pointer to message buffer *)
- more*: BOOLEAN; (* 56 --> if more data in this block will be written *)
- filler2*: Types.SInt8; (* unsigned char *)
- userData*: LONGINT; (* 58 --> Message block userData Uninterpreted by PPC *)
- blockCreator*: Types.OSType; (* 62 --> Message block creator Uninterpreted by PPC *)
- blockType*: Types.OSType; (* 66 --> Message block type Uninterpreted by PPC *)
- END;
-
- PPCWritePBPtr* = POINTER TO PPCWritePBRec;
-
- PPCReadPBRec* = RECORD
- qLink*: Types.Ptr;
- csCode*: INTEGER;
- intUse*: INTEGER;
- intUsePtr*: Types.Ptr;
- ioCompletion*: PPCCompUPP;
- ioResult*: Types.OSErr;
- Reserved*: ARRAY 5 (*ΔΔ[0..4]ΔΔ*) OF LONGINT;
- filler1*: INTEGER;
- sessRefNum*: PPCSessRefNum; (* 40 --> Session Reference *)
- bufferLength*: Memory.Size; (* 44 --> Length of the message buffer *)
- actualLength*: Memory.Size; (* 48 <-- Actual length read *)
- bufferPtr*: Types.Ptr; (* 52 --> Pointer to message buffer *)
- more*: BOOLEAN; (* 56 <-- if true more data in this block to be read *)
- filler2*: Types.SInt8; (* unsigned char *)
- userData*: LONGINT; (* 58 <-- Message block userData Uninterpreted by PPC *)
- blockCreator*: Types.OSType; (* 62 <-- Message block creator Uninterpreted by PPC *)
- blockType*: Types.OSType; (* 66 <-- Message block type Uninterpreted by PPC *)
- END;
-
- PPCReadPBPtr* = POINTER TO PPCReadPBRec;
-
- PPCEndPBRec* = RECORD
- qLink*: Types.Ptr;
- csCode*: INTEGER;
- intUse*: INTEGER;
- intUsePtr*: Types.Ptr;
- ioCompletion*: PPCCompUPP;
- ioResult*: Types.OSErr;
- Reserved*: ARRAY 5 (*ΔΔ[0..4]ΔΔ*) OF LONGINT;
- filler1*: INTEGER;
- sessRefNum*: PPCSessRefNum; (* 40 --> Session Reference *)
- END;
-
- PPCEndPBPtr* = POINTER TO PPCEndPBRec;
-
- PPCClosePBRec* = RECORD
- qLink*: Types.Ptr;
- csCode*: INTEGER;
- intUse*: INTEGER;
- intUsePtr*: Types.Ptr;
- ioCompletion*: PPCCompUPP;
- ioResult*: Types.OSErr;
- Reserved*: ARRAY 5 (*ΔΔ[0..4]ΔΔ*) OF LONGINT;
- portRefNum*: PPCPortRefNum; (* 38 --> Port Identifier *)
- END;
-
- PPCClosePBPtr* = POINTER TO PPCClosePBRec;
-
- IPCListPortsPBRec* = RECORD
- qLink*: Types.Ptr;
- csCode*: INTEGER;
- intUse*: INTEGER;
- intUsePtr*: Types.Ptr;
- ioCompletion*: PPCCompUPP;
- ioResult*: Types.OSErr;
- Reserved*: ARRAY 5 (*ΔΔ[0..4]ΔΔ*) OF LONGINT;
- filler1*: INTEGER;
- startIndex*: INTEGER; (* 40 --> Start Index *)
- requestCount*: INTEGER; (* 42 --> Number of entries to be returned *)
- actualCount*: INTEGER; (* 44 <-- Actual Number of entries to be returned *)
- portName*: PPCPortPtr; (* 46 --> PortName Match *)
- locationName*: LocationNamePtr; (* 50 --> NBP or NAS type name to locate the Port Location *)
- bufferPtr*: PortInfoArrayPtr; (* 54 --> Pointer to a buffer requestCount*sizeof(PortInfo) bytes big *)
- END;
-
- IPCListPortsPBPtr* = POINTER TO IPCListPortsPBRec;
-
- PPCParamBlockRec* = RECORD
- (*ΔΔ CASE INTEGER OF
- 0: (
- openParam*: PPCOpenPBRec;
- );
- 1: (
- informParam*: PPCInformPBRec;
- );
- 2: (
- startParam*: PPCStartPBRec;
- );
- 3: (
- acceptParam*: PPCAcceptPBRec;
- );
- 4: (
- rejectParam*: PPCRejectPBRec;
- );
- 5: (
- writeParam*: PPCWritePBRec;
- );
- 6: (
- readParam*: PPCReadPBRec;
- );
- 7: (
- endParam*: PPCEndPBRec;
- );
- 8: (
- closeParam*: PPCClosePBRec;
- );
- 9: (
- listPortsParam*: IPCListPortsPBRec;
- );*)
- END;
-
-
- PROCEDURE PPCInit*(): Types.OSErr;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $7000, $A0DD, $3E80;
- (*$END*)
- PROCEDURE PPCOpen*(pb: PPCOpenPBPtr; async: BOOLEAN): Types.OSErr;
- EXTERNAL PASCAL;
- PROCEDURE PPCOpenSync*(pb: PPCOpenPBPtr): Types.OSErr;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $205F, $7001, $A0DD, $3E80;
- (*$END*)
- PROCEDURE PPCOpenAsync*(pb: PPCOpenPBPtr): Types.OSErr;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $205F, $7001, $A4DD, $3E80;
- (*$END*)
- PROCEDURE PPCInform*(pb: PPCOpenPBPtr; async: BOOLEAN): Types.OSErr;
- EXTERNAL PASCAL;
- PROCEDURE PPCInformSync*(pb: PPCInformPBPtr): Types.OSErr;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $205F, $7003, $A0DD, $3E80;
- (*$END*)
- PROCEDURE PPCInformAsync*(pb: PPCInformPBPtr): Types.OSErr;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $205F, $7003, $A4DD, $3E80;
- (*$END*)
- PROCEDURE PPCStart*(pb: PPCOpenPBPtr; async: BOOLEAN): Types.OSErr;
- EXTERNAL PASCAL;
- PROCEDURE PPCStartSync*(pb: PPCStartPBPtr): Types.OSErr;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $205F, $7002, $A0DD, $3E80;
- (*$END*)
- PROCEDURE PPCStartAsync*(pb: PPCStartPBPtr): Types.OSErr;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $205F, $7002, $A4DD, $3E80;
- (*$END*)
- PROCEDURE PPCAccept*(pb: PPCOpenPBPtr; async: BOOLEAN): Types.OSErr;
- EXTERNAL PASCAL;
- PROCEDURE PPCAcceptSync*(pb: PPCAcceptPBPtr): Types.OSErr;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $205F, $7004, $A0DD, $3E80;
- (*$END*)
- PROCEDURE PPCAcceptAsync*(pb: PPCAcceptPBPtr): Types.OSErr;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $205F, $7004, $A4DD, $3E80;
- (*$END*)
- PROCEDURE PPCReject*(pb: PPCOpenPBPtr; async: BOOLEAN): Types.OSErr;
- EXTERNAL PASCAL;
- PROCEDURE PPCRejectSync*(pb: PPCRejectPBPtr): Types.OSErr;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $205F, $7005, $A0DD, $3E80;
- (*$END*)
- PROCEDURE PPCRejectAsync*(pb: PPCRejectPBPtr): Types.OSErr;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $205F, $7005, $A4DD, $3E80;
- (*$END*)
- PROCEDURE PPCWrite*(pb: PPCOpenPBPtr; async: BOOLEAN): Types.OSErr;
- EXTERNAL PASCAL;
- PROCEDURE PPCWriteSync*(pb: PPCWritePBPtr): Types.OSErr;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $205F, $7006, $A0DD, $3E80;
- (*$END*)
- PROCEDURE PPCWriteAsync*(pb: PPCWritePBPtr): Types.OSErr;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $205F, $7006, $A4DD, $3E80;
- (*$END*)
- PROCEDURE PPCRead*(pb: PPCOpenPBPtr; async: BOOLEAN): Types.OSErr;
- EXTERNAL PASCAL;
- PROCEDURE PPCReadSync*(pb: PPCReadPBPtr): Types.OSErr;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $205F, $7007, $A0DD, $3E80;
- (*$END*)
- PROCEDURE PPCReadAsync*(pb: PPCReadPBPtr): Types.OSErr;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $205F, $7007, $A4DD, $3E80;
- (*$END*)
- PROCEDURE PPCEnd*(pb: PPCOpenPBPtr; async: BOOLEAN): Types.OSErr;
- EXTERNAL PASCAL;
- PROCEDURE PPCEndSync*(pb: PPCEndPBPtr): Types.OSErr;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $205F, $7008, $A0DD, $3E80;
- (*$END*)
- PROCEDURE PPCEndAsync*(pb: PPCEndPBPtr): Types.OSErr;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $205F, $7008, $A4DD, $3E80;
- (*$END*)
- PROCEDURE PPCClose*(pb: PPCOpenPBPtr; async: BOOLEAN): Types.OSErr;
- EXTERNAL PASCAL;
- PROCEDURE PPCCloseSync*(pb: PPCClosePBPtr): Types.OSErr;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $205F, $7009, $A0DD, $3E80;
- (*$END*)
- PROCEDURE PPCCloseAsync*(pb: PPCClosePBPtr): Types.OSErr;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $205F, $7009, $A4DD, $3E80;
- (*$END*)
- PROCEDURE IPCListPorts*(pb: PPCOpenPBPtr; async: BOOLEAN): Types.OSErr;
- EXTERNAL PASCAL;
- PROCEDURE IPCListPortsSync*(pb: IPCListPortsPBPtr): Types.OSErr;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $205F, $700A, $A0DD, $3E80;
- (*$END*)
- PROCEDURE IPCListPortsAsync*(pb: IPCListPortsPBPtr): Types.OSErr;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $205F, $700A, $A4DD, $3E80;
- (*$END*)
- PROCEDURE DeleteUserIdentity*(userRef: LONGINT): Types.OSErr;
- EXTERNAL PASCAL;
- PROCEDURE GetDefaultUser*(VAR userRef: LONGINT; VAR userName: Types.Str32): Types.OSErr;
- EXTERNAL PASCAL;
- PROCEDURE StartSecureSession*(pb: PPCStartPBPtr; VAR userName: Types.Str32; useDefault: BOOLEAN; allowGuest: BOOLEAN; VAR guestSelected: BOOLEAN; prompt: Types.ConstStr255Param): Types.OSErr;
- EXTERNAL PASCAL;
- TYPE
- PPCFilterProcPtr* = (*ΔΔ Types.ProcPtr;*) PROCEDURE (name: LocationNamePtr; port: PortInfoPtr): BOOLEAN;
- PPCFilterUPP* = Types.UniversalProcPtr;
-
- CONST
- uppPPCCompProcInfo* = $000000C0; (* PROCEDURE (4 byte param); *)
- uppPPCFilterProcInfo* = $000003D0; (* PROCEDURE (4 byte param, 4 byte param): 1 byte result; *)
-
- PROCEDURE NewPPCCompProc*(userRoutine: PPCCompProcPtr): PPCCompUPP;
- (*$IF NOT GENERATINGCFM *)
- INLINE PASCAL $2E9F;
- (*$END*)
-
- PROCEDURE NewPPCFilterProc*(userRoutine: PPCFilterProcPtr): PPCFilterUPP;
- (*$IF NOT GENERATINGCFM *)
- INLINE PASCAL $2E9F;
- (*$END*)
-
- PROCEDURE CallPPCCompProc*(pb: PPCParamBlockPtr; userRoutine: PPCCompUPP);
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $205F, $4E90;
- (*$END*)
-
- PROCEDURE CallPPCFilterProc*(name: LocationNamePtr; port: PortInfoPtr; userRoutine: PPCFilterUPP): BOOLEAN;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $205F, $4E90;
- (*$END*)
-
- PROCEDURE PPCBrowser*(prompt: Types.ConstStr255Param; applListLabel: Types.ConstStr255Param; defaultSpecified: BOOLEAN; VAR theLocation: LocationNameRec; VAR thePortInfo: PortInfoRec; portFilter: PPCFilterUPP; theLocNBPType: Types.ConstStr32Param): Types.OSErr;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $303C, $0D00, $A82B;
- (*$END*)
-
- (* $ALIGN RESET*)
- (* $POP*)
-
- END PPCToolbox.
-